package com.bxj.wxtt.service.impl;

import com.bxj.wxtt.api.domain.AdvChannel;
import com.bxj.wxtt.mapper.master.AdvChannelMasterMapper;
import com.bxj.wxtt.mapper.slave.AdvChannelSlaveMapper;
import com.bxj.wxtt.service.AdvChannelService;
import com.ifeng.matrix.common.domain.PageResult;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 由MyBatis Generator工具自动生成 2018-07-18 19:49:05
 */
@Component("advChannelService")
public class AdvChannelServiceImpl implements AdvChannelService {
    @Resource
    AdvChannelMasterMapper advChannelMasterMapper;

    @Resource
    AdvChannelSlaveMapper advChannelSlaveMapper;

    public List<AdvChannel> getAdvChannelList(AdvChannel advChannel) {
        return advChannelSlaveMapper.getAdvChannelList(advChannel);
    }

    public AdvChannel selectById(Integer id) {
        return advChannelSlaveMapper.selectById(id);
    }

    public PageResult<AdvChannel> getAdvChannelPage(AdvChannel advChannel) {
        PageResult pageResult = new PageResult();
        pageResult.setCount(advChannelSlaveMapper.countSeletive(advChannel));
        pageResult.setResult(advChannelSlaveMapper.getAdvChannelList(advChannel));
        return pageResult;
    }

    public int insert(AdvChannel advChannel) {
        return advChannelMasterMapper.insert(advChannel);
    }

    public int deleteAdvChannelById(Integer id) {
        return advChannelMasterMapper.deleteAdvChannelById(id);
    }

    public int updateAdvChannelById(AdvChannel advChannel) {
        return advChannelMasterMapper.updateAdvChannelById(advChannel);
    }
}